package com.zealfi.example.test.rabbitmq.amqp.producer;


import com.zealfi.example.test.rabbitmq.base.MsgSendConfirmReturnsCallBack;
import com.zealfi.example.test.rabbitmq.constant.QueueEnum;
import com.zealfi.example.test.rabbitmq.pojo.MemberPojo;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;


/**
 * @功能:【LoanApplyMQProducer 申请生产者】
 * @作者:代守诚
 * @日期:2018/10/19
 * @时间:17:01
 */
@Component
public class LoanApplyMQProducer extends MsgSendConfirmReturnsCallBack {

    public LoanApplyMQProducer(@Qualifier("amqpTemplate") RabbitTemplate rabbitTemplate) {
        super(rabbitTemplate);
    }

    @Override
    protected void changeStatus(String correlationDataId) {
        //根据需求完成状态修改
    }

    public boolean send(MemberPojo memberPojo) {
        memberPojo.setId(92L);
        memberPojo.setIdCardCode("3*************8");
        memberPojo.setBirthday(new Timestamp(System.currentTimeMillis()));
        memberPojo.setNickName("王者荣耀");
        memberPojo.setPhoneNumber("176****5555");
        memberPojo.setSex(1);
        memberPojo.setUserName("CN Dota2");
        return sendMsg(QueueEnum.BD_FENQI_APPLY_QUEUE.getRoutingKey(), memberPojo);
    }
}
